/*************************************************************************
 > File Name: offset.h
 > Author: LiuTianpeng
 > Mail: ltpforever@163.com 
 > Created Time: 2017年07月31日 星期一 17时25分01秒
 ************************************************************************/

#ifndef _OFFSET_H_
#define _OFFSET_H_

/*=======南网交易记录部分=========*/

typedef enum {
	GUNTAB_OFFSET = 0,
	FLAG_FINISHED_OFFSET,
	SERIALNUM_OFFSET,
	STARTTIME_OFFSET,
	ENDTIME_OFFSET,
	CHARGE_DURATION_OFFSET,
	PAYCARD_OFFSET,
	USERID_OFFSET,
	CARDID_OFFSET,
	MODELID_OFFSET,
	STOP_REASON_OFFSET,
	BILLBYTM_OFFSET,
	W_START0_OFFSET,
	W_START1_OFFSET,
	W_START2_OFFSET,
	W_START3_OFFSET,
	W_START4_OFFSET,
	W_END0_OFFSET,
	W_END1_OFFSET,
	W_END2_OFFSET,
	W_END3_OFFSET,
	W_END4_OFFSET,
	W0_OFFSET,
	W1_OFFSET,
	W2_OFFSET,
	W3_OFFSET,
	W4_OFFSET,
	COST_ELEC0_OFFSET,
	COST_ELEC1_OFFSET,
	COST_ELEC2_OFFSET,
	COST_ELEC3_OFFSET,
	COST_ELEC4_OFFSET,
	COST_SERVER_OFFSET,
	COST_PARKING_OFFSET,
	RATEPRICE0_OFFSET,
	RATEPRICE1_OFFSET,
	RATEPRICE2_OFFSET,
	RATEPRICE3_OFFSET,
	RATEPRICE4_OFFSET,
	RATEPRICE5_OFFSET,
	RATEPRICE6_OFFSET,
	CARLOGO_OFFSET,
	FLAG_CARD_SETTLED_OFFSET,
	TAC_OFFSET,
	LOGIC_CARDNUM_OFFSET,
	PHY_CARDNUM_OFFSET,
	TICKET_TRADE_COUNT_OFFSET,
	TRADE_MONEY_OFFSET,
	BALANCE_OFFSET,
} NW_TRAN_OFFSET;

/*=======小桔交易记录部分=========*/
typedef enum {
	XJ_GUNTAB_OFFSET,
	XJ_FLAG_FINISHED_OFFSET,
	XJ_SERIALNUM_OFFSET,
	XJ_STARTTIME_OFFSET,
	XJ_ENDT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OFFSET,
} XJ_TRAN_OFFSET;

/*=======故障记录部分======*/
#define ERR_GUNTAB_OFFSET 0
#define ERR_TIME_OFFSET 1
#define ERR_TYPE_OFFSET 2

/*======系统配置部分======*/
#define SETTAG1_OFFSET 0
#define BITTAG1_OFFSET 1
#define DEV_NUM_OFFSET 2
#define SETTAG2_OFFSET 3
#define BITTAG2_OFFSET 4
#define APN_OFFSET 5
#define REMOTE_IP1_OFFSET 6
#define PORT1_OFFSET 7
#define REMOTE_IP2_OFFSET 8
#define PORT2_OFFSET 9
#define LOCAL_IP1_OFFSET 10
#define MASK1_OFFSET 11
#define GATEWAY1_OFFSET 12
#define LOCAL_IP2_OFFSET 13
#define MASK2_OFFSET 14
#define GATEWAY2_OFFSET 15
#define SETTAG3_OFFSET 16
#define RATE_V_OFFSET 17
#define OVER_V_OFFSET 18
#define UNDER_V_OFFSET 19
#define OVER_V_REAGIN_OFFSET 20
#define UNDER_V_REAGIN_OFFSET 21
#define RATE_A_OFFSET  22
#define OVER_A_OFFSET 23
#define UNDER_A_OFFSET 24
#define OVER_A_REAGIN_OFFSET 25
#define UNDER_A_REAGIN_OFFSET 26
#define CON_TIME_OFFSET 27

/*=======计费模型部分=====*/
#define PM_GUNTAB_OFFSET 0
#define PM_MODELID_OFFSET 1
#define PM_STARTTIME_OFFSET 2
#define PM_ENDTIME_OFFSET 3
#define PM_OPSTATE_OFFSET 4
#define PM_METERTYPE_OFFSET 5
#define PM_NUM_OFFSET 6

#define PM_TIME0_OFFSET 7
#define PM_TAG0_OFFSET 8
#define PM_TIME1_OFFSET 9
#define PM_TAG1_OFFSET 10
#define PM_TIME2_OFFSET 11
#define PM_TAG2_OFFSET 12
#define PM_TIME3_OFFSET 13
#define PM_TAG3_OFFSET 14
#define PM_TIME4_OFFSET 15
#define PM_TAG4_OFFSET 16
#define PM_TIME5_OFFSET 17
#define PM_TAG5_OFFSET 18
#define PM_TIME6_OFFSET 19
#define PM_TAG6_OFFSET 20
#define PM_TIME7_OFFSET 21
#define PM_TAG7_OFFSET 22
#define PM_TIME8_OFFSET 23
#define PM_TAG8_OFFSET 24
#define PM_TIME9_OFFSET 25
#define PM_TAG9_OFFSET 26
#define PM_TIME10_OFFSET 27
#define PM_TAG10_OFFSET 28
#define PM_TIME11_OFFSET 29
#define PM_TAG11_OFFSET 30

#define PM_RATEPRICE0_OFFSET 31
#define PM_RATEPRICE1_OFFSET 32
#define PM_RATEPRICE2_OFFSET 33
#define PM_RATEPRICE3_OFFSET 34
#define PM_RATEPRICE4_OFFSET 35
#define PM_RATEPRICE5_OFFSET 36
#define PM_RATEPRICE6_OFFSET 37

/*=========管理卡部分=======*/
#define ADMIN_CARD_ID_OFFSET 0
#define ADMIN_CARD_TYPE_OFFSET 1
#define ADMIN_CARD_ORDER_OFFSET 2

/*==========充电枪部分========*/
typedef enum {
	GUN_GUNNO_OFFSET=0,
	GUN_CAN_PORT_OFFSET,
	GUN_FRAME_GUNNO_OFFSET,
	GUN_CHA_ADDR_OFFSET,
	GUN_MT_PORT_OFFSET,
	GUN_PHASE_NUM_OFFSET,
	GUN_METERADDR_OFFSET,
	GUN_CT_OFFSET,
}GUNINFO_OFFSET;

typedef enum{
	CODE_CONTEXT = 0,
	CODE_SWCODE,
	CODE_XJCODE,
}CODE_OFFSET;

#endif

